//
//  StoryDetailsCell.m
//  PetTown
//
//  Created by lanou3g on 15/5/30.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "StoryDetailsCell.h"
#import "StoryDetailsTableViewController.h"
@implementation StoryDetailsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //图片
        self.storyDetails_imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 200)];

        [self.contentView addSubview:_storyDetails_imageView];
        
         _pl_View.alpha = 1;

        
        //新建
        self.contentView.frame = CGRectMake(self.contentView.frame.origin.x, self.contentView.frame.origin.y, [UIScreen mainScreen].bounds.size.width, self.contentView.frame.size.height);
        
        //评论头像
        self.plz_imageView = [[UIImageView alloc]init];
        _plz_imageView.frame = CGRectMake(5, 10, 40, 40);
        [self.contentView addSubview:_plz_imageView];
        //评论昵称
        self.plz_nameLable = [[UILabel alloc]initWithFrame:CGRectMake( 55, 5,self.contentView.frame.size.width - 155, 45)];
        _plz_nameLable.numberOfLines = 0;
       
        [self.contentView addSubview:_plz_nameLable];
        //评论内容
        self.plz_commentContent = [[UILabel alloc]initWithFrame:CGRectMake(55, 50, self.contentView.frame.size.width-60, 55)];

        _plz_commentContent.numberOfLines = 0;
       
        [self.contentView addSubview:_plz_commentContent];
        //评论时间
        self.plz_time = [[UILabel alloc]initWithFrame:CGRectMake(self.contentView.frame.size.width - 90, 10, 80, 30)];
    
         [self.contentView addSubview:_plz_time];
      
        //第几位评论者
        self.plz_number = [[UILabel alloc] initWithFrame:CGRectMake(10, 55, 30, 20)];
        [self.contentView addSubview:_plz_number];

    }
    return self;
}


- (void)setStoryDetails:(StoryDetails *)storyDetails
{
    [_plz_imageView sd_setImageWithURL:[NSURL URLWithString:storyDetails.avatar]];
    
    _plz_nameLable.text = [NSString stringWithFormat:@"{%@}的'%@'",storyDetails.nickname,storyDetails.disname];
    

    _plz_commentContent.text = storyDetails.content;
 
    _plz_time.text = storyDetails.time;
    _plz_time.textAlignment = NSTextAlignmentRight;
    _plz_number.text =[NSString stringWithFormat:@"%@F",storyDetails.lou];
    _plz_number.textAlignment = NSTextAlignmentCenter;
    [_storyDetails_imageView sd_setImageWithURL:[NSURL URLWithString:storyDetails.photo]];

   
}


- (void)awakeFromNib {
    // Initialization code
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    

    // Configure the view for the selected state
}

@end
